$(function() {
	var btn = ['工作票', '操作票', '缺陷管理']
	var swiper = new Swiper('.swiper-container', {
		pagination: {
			el: '.swiper-pagination',
			clickable: true,
			renderBullet: function(index, className) {
				console.log(className)
				return '<span class="' + className + '">' + btn[index] + '</span>';
			},
		},
	});
	var gzpChart = echarts.init(document.getElementById('GZPchart'));
	
	GZPOption = {
				legend: {
//					x: 'center',	
					left:'10%',
					y: '80%',
					textStyle: {
						color: '#fff'
					},
					data: ['未完成', '已完成', '超期']
				},
				grid: {
					x: '40%',
					y: '7%',
					width: '55%',
					height: '80%'
				},
				xAxis: {
					type: 'category',
					axisLine: {
						lineStyle: {
							color: '#5bbcd9'
						}

					},
					axisTick: {
						show: false
					},
					axisLabel: {
						color: '#fff'
					},
					data: ['已完成', '未完成', '超期']
				},
				yAxis: {
					axisLine: {
						lineStyle: {
							color: '#5bbcd9',

						}
					},
					splitLine: {
						show: true,
						lineStyle: {
							color: '#5bbcd9'
						}
					},
					axisTick: {
						show: false
					},
					axisLabel: {
						textStyle: {
							color: '#5bbcd9'
						}
					},
					type: 'value'
				},
				tooltip: {
					trigger: 'axis',
					axisPointer: { // 坐标轴指示器，坐标轴触发有效
						type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
					}
				},
				series:[{
//					name: 'pie',
					type: 'pie',
					radius: '50%',
					center: ['20%','50%'],
//					clockwise: false,
					data: [{
						value: '10',
						name: '未完成',
					}, {
						value: '13',
						name: '已完成'
					}, {
						value: '77',
						name: '超期'
					}],
					label: {
						normal: {
							textStyle: {
								color: '#fff',
								fontSize: 14,
							},
							formatter: '{d}%'
						}
					},
					labelLine: {
						normal: {
							show: true,
							lineStyle: {
								color: '#fff'
							}
						}
					},
					itemStyle: {
						emphasis: {
							borderWidth: 0,
							shadowBlur: 10,
							shadowOffsetX: 0,
							shadowColor: 'rgba(0, 0, 0, 0.5)'
						}
					},
					color: ['#4777f5', '#44aff0', '#45dbf7']
				}, {
//					name: 'bar',
					type: 'bar',
					barMaxWidth: 30,
					itemStyle: {
						normal: {
							color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
								offset: 0,
								color: '#00dfff'
							}, {
								offset: 1,
								color: '#3475d1'
							}]),
						}
					},
					data: [{
						value: '10',
						name: '未完成',
					}, {
						value: '13',
						name: '已完成'
					}, {
						value: '77',
						name: '超期'
					}]

				}]
			}
			gzpChart.setOption(GZPOption)
})